package com.sun.dao;

import com.sun.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;


import java.util.List;

public interface UserMapper extends Mapper<User> {

    @Select("select * from user where id=#{id}")
    User selectUserById(Integer id) throws Exception;

    @Insert("insert into user(name,sex,age) values(#{name},#{sex},#{age})")
    int addUser(User user) throws Exception;

    List<User> getUserList() throws Exception;

    int updateByid(User user);

    @Delete("delete from user where id = #{id};")
    void deleteByid(Integer id);
}